package com.beesoft.demo.repository;

import com.beesoft.demo.entity.Language;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface LanguageRepository extends JpaRepository<Language, Long> {
    Optional<Language> findByCode(String code);
    
    // 搜索方法：在 code 或 title 字段中查找（忽略大小写）
    Page<Language> findByCodeContainingIgnoreCaseOrTitleContainingIgnoreCase(
            String code, String title, Pageable pageable);
}

